package y23.Oct;

import java.util.ArrayList;
import java.util.Scanner;

public class Test18 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M  = scanner.nextInt();
        int[] K = new int[M];
        int[] B = new int[M];
        int[] MN = new int[M];
        for (int i = 0; i < M; i++) {
            K[i] = scanner.nextInt();
            B[i] = scanner.nextInt();
        }
        int maxPrice = Mnum(MN,N,M);
    }
    public static int Mnum(int[] MN,int N,int M){
        if(M == 1){
            maxPrice(MN);
        }
        for (int i = 0; i < N; i++) {
            MN[M-1] = i;
            M--;
            N--;
            Mnum(MN,N,M);
        }
        return 0;
    }
    public static int maxPrice(int[] MN){

        return 0;
    }
}
